#!/usr/bin/python3
# coding=utf-8
import sys
import os
import json
import random

class CpingDeamon(object):
    def __init__(self, f):
        super(CpingDeamon, self).__init__()
        self._file = f

    def proc(self):
        dPing = {"stat": None, "seq": []}
        for l in self._file.readlines():
            obj = json.loads(l)
            if "stat" in obj:
                dPing['stat'] = obj["stat"]
            else:
                dPing["seq"].append(obj)
        s = json.dumps(dPing, indent=4)
        print(s)

if __name__ == "__main__":
    with open(sys.argv[1], "r") as f:
        c = CpingDeamon(f)
        c.proc()